package com.fowo.api.controller.purchase;

import com.fowo.api.common.model.R;
import com.fowo.api.mapper.QualityCheckStorageMapper;
import com.fowo.api.model.quality.check.storage.QualityCheckStorageVo;
import com.fowo.api.service.QualityCheckStorageService;
import com.fowo.api.service.handleWork.QualityCheckStorageDServiceImpl;
import com.fowo.api.service.impl.QualityCheckStorageBaseServiceImpl;
import com.fowo.api.service.impl.QualityCheckStorageServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Tag(name = "质检单")
@RequestMapping("/api/quality-check-storage")
@RestController
public class QualityCheckStorageDController {

    @Resource
    private QualityCheckStorageDServiceImpl service;

    @Operation(summary = "批量质检")
    @PutMapping("/batchUpdate")
    public R update(@RequestBody List<QualityCheckStorageVo> models) {
        return R.run(() -> service.batchUpdate(models));
    }
}
